VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "comctl32.ocx"
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Object = "{736A8444-E374-41A8-B526-1B07FD2F3F5B}#1.0#0"; "BLacKPeaRLOCX.ocx"
Begin VB.Form FrmDesktopClient 
   BackColor       =   &H00000000&
   Caption         =   "Desktop Client Viewer"
   ClientHeight    =   9735
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   11190
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "FrmDesktopClient.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   649
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   746
   StartUpPosition =   2  'CenterScreen
   Begin VB.Timer tmrimage 
      Enabled         =   0   'False
      Interval        =   50
      Left            =   9960
      Top             =   8880
   End
   Begin VB.PictureBox Picture2 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   2775
      Left            =   0
      ScaleHeight     =   2745
      ScaleWidth      =   2865
      TabIndex        =   6
      Top             =   6600
      Visible         =   0   'False
      Width           =   2895
      Begin ComctlLib.ListView lvIp 
         Height          =   2745
         Left            =   240
         TabIndex        =   8
         Top             =   0
         Width           =   2655
         _ExtentX        =   4683
         _ExtentY        =   4842
         View            =   3
         MultiSelect     =   -1  'True
         LabelWrap       =   -1  'True
         HideSelection   =   -1  'True
         _Version        =   327682
         ForeColor       =   49152
         BackColor       =   0
         BorderStyle     =   1
         Appearance      =   1
         NumItems        =   3
         BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
            Key             =   ""
            Object.Tag             =   ""
            Text            =   "No"
            Object.Width           =   1411
         EndProperty
         BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
            SubItemIndex    =   1
            Key             =   ""
            Object.Tag             =   ""
            Text            =   "No"
            Object.Width           =   0
         EndProperty
         BeginProperty ColumnHeader(3) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
            SubItemIndex    =   2
            Key             =   ""
            Object.Tag             =   ""
            Text            =   "IP Address"
            Object.Width           =   2540
         EndProperty
      End
   End
   Begin VB.PictureBox Toolbar 
      BackColor       =   &H00404040&
      BorderStyle     =   0  'None
      Height          =   1605
      Left            =   0
      ScaleHeight     =   1605
      ScaleWidth      =   11220
      TabIndex        =   0
      Top             =   9360
      Width           =   11220
      Begin VB.ComboBox cboCom 
         Height          =   315
         Left            =   3360
         TabIndex        =   2
         Top             =   720
         Width           =   1590
      End
      Begin VB.TextBox txtnoclient 
         Height          =   285
         Left            =   2640
         TabIndex        =   1
         Top             =   720
         Width           =   495
      End
      Begin BLacKPeaRLOCX.ButtonNix cmdCOnnect 
         Height          =   375
         Left            =   3240
         TabIndex        =   3
         Top             =   0
         Width           =   1215
         _ExtentX        =   2143
         _ExtentY        =   661
         BTYPE           =   5
         TX              =   "Hubungkan"
         ENAB            =   -1  'True
         BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         COLTYPE         =   2
         FOCUSR          =   0   'False
         BCOL            =   1184274
         BCOLO           =   16777215
         FCOL            =   49152
         FCOLO           =   49152
         MCOL            =   12632256
         MPTR            =   1
         MICON           =   "FrmDesktopClient.frx":0E42
         UMCOL           =   -1  'True
         SOFT            =   0   'False
         PICPOS          =   0
         NGREY           =   0   'False
         FX              =   0
         HAND            =   0   'False
         CHECK           =   0   'False
         VALUE           =   0   'False
      End
      Begin BLacKPeaRLOCX.ButtonNix cmdPilih 
         Height          =   375
         Left            =   0
         TabIndex        =   4
         Top             =   0
         Width           =   2895
         _ExtentX        =   5106
         _ExtentY        =   661
         BTYPE           =   5
         TX              =   "Pilih Client"
         ENAB            =   -1  'True
         BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         COLTYPE         =   2
         FOCUSR          =   0   'False
         BCOL            =   1184274
         BCOLO           =   16777215
         FCOL            =   49152
         FCOLO           =   49152
         MCOL            =   12632256
         MPTR            =   1
         MICON           =   "FrmDesktopClient.frx":0E5E
         UMCOL           =   -1  'True
         SOFT            =   0   'False
         PICPOS          =   0
         NGREY           =   0   'False
         FX              =   0
         HAND            =   0   'False
         CHECK           =   0   'False
         VALUE           =   0   'False
      End
      Begin BLacKPeaRLOCX.ButtonNix cmdclean 
         Height          =   375
         Left            =   4680
         TabIndex        =   9
         Top             =   0
         Width           =   1215
         _ExtentX        =   2143
         _ExtentY        =   661
         BTYPE           =   5
         TX              =   "Bersihkan"
         ENAB            =   -1  'True
         BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         COLTYPE         =   2
         FOCUSR          =   0   'False
         BCOL            =   1184274
         BCOLO           =   16777215
         FCOL            =   49152
         FCOLO           =   49152
         MCOL            =   12632256
         MPTR            =   1
         MICON           =   "FrmDesktopClient.frx":0E7A
         UMCOL           =   -1  'True
         SOFT            =   0   'False
         PICPOS          =   0
         NGREY           =   0   'False
         FX              =   0
         HAND            =   0   'False
         CHECK           =   0   'False
         VALUE           =   0   'False
      End
      Begin VB.Label Label3 
         Alignment       =   2  'Center
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "                  "
         ForeColor       =   &H000000FF&
         Height          =   195
         Left            =   3810
         TabIndex        =   5
         Top             =   360
         Width           =   810
      End
   End
   Begin BLacKPeaRLOCX.Resize Resize1 
      Left            =   9480
      Top             =   8880
      _ExtentX        =   847
      _ExtentY        =   847
   End
   Begin MSWinsockLib.Winsock wsckImage 
      Left            =   0
      Tag             =   "0"
      Top             =   0
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin VB.Image imgImage 
      Height          =   9015
      Left            =   0
      Stretch         =   -1  'True
      Top             =   0
      Width           =   11175
   End
   Begin VB.Label lblstat 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   375
      Left            =   0
      TabIndex        =   7
      Top             =   3840
      Width           =   11175
   End
End
Attribute VB_Name = "FrmDesktopClient"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rempic As New ADODB.Stream

Private Sub cmdclean_Click()
rec.Open "Delete rem.* From rem", conn, adOpenStatic, adLockOptimistic
End Sub

Private Sub cmdConnect_Click()

'On Error GoTo hell
    rec.Open "SELECT ip.*,port.port FROM ip,port WHERE ip.ip = port.ip AND ip.no_client = " & Val(txtnoclient.Text), conn, adOpenStatic, adLockOptimistic
    If Not rec.RecordCount = 0 Then
        If FrmMain.Winsock(rec(2)).State = 7 Then
            FrmMain.Winsock(rec(2)).SendData "startremdesk|_|_|_|_|_|_|"
            tmrimage.Enabled = True
            Toolbar.Visible = False
        End If
    End If
    rec.Close
   

'IfNoErr:
'Exit Sub
'hell:
' TulisError Err.Description, Err.Number, "cmdLock", Me.Name
' Resume IfNoErr

End Sub

Private Sub cmdPilih_Click()
Picture2.Visible = True
End Sub
'
Private Sub Form_Load()
Call Grid
'RefreshList
StyleS
End Sub

Private Sub Grid()
'On Error GoTo hell
rec.Open "select ip.* from ip order by no_client asc, no_client", conn, , adLockOptimistic
With rec
While Not .EOF
Set lstItem = lvIp.ListItems.Add(, , !No_Client)
lstItem.SubItems(1) = !No_Client
lstItem.SubItems(2) = !ip

.MoveNext
Wend
End With
rec.Close
'IfNoErr:
'Exit Sub
'hell:
' TulisError Err.Description, Err.Number, "Grid", Me.Name
'Resume IfNoErr

End Sub
'
'
Private Sub Form_Resize()
Me.BorderStyle = 2
Me.ClipControls = True
imgImage.Width = ScaleWidth
imgImage.Height = ScaleHeight

End Sub

Private Sub Form_Unload(Cancel As Integer)
'On Error GoTo hell
    rec.Open "SELECT ip.*,port.port FROM ip,port WHERE ip.ip = port.ip AND ip.no_client = " & Val(txtnoclient.Text), conn, adOpenStatic, adLockOptimistic
    If Not rec.RecordCount = 0 Then
        If FrmMain.Winsock(rec(2)).State = sckConnected Then
            FrmMain.Winsock(rec(2)).SendData "stopremdesk|_|_|_|_|_|_|"
            tmrimage.Enabled = False
'            Toolbar.Visible = False
        End If
    End If
    rec.Close
   
'
'IfNoErr:
'Exit Sub
'hell:
' TulisError Err.Description, Err.Number, "cmdLock", Me.Name
' Resume IfNoErr

End Sub

Private Sub imgImage_DblClick()
On Error Resume Next
WindowState = 2
Me.BorderStyle = 0
Me.Width = Screen.Width
Me.Height = Screen.Height
End Sub

Private Sub lvIp_Click()
'On Error GoTo hell
txtnoclient.Text = lvIp.ListItems(lvIp.SelectedItem.Index).SubItems(1)
cboCom.Text = lvIp.ListItems(lvIp.SelectedItem.Index).SubItems(2)
'hell:
'If Err.Number = 91 Then
'On Error Resume Next
'End If
End Sub
'
Private Sub lvIp_DblClick()
'On Error GoTo hell
txtnoclient.Text = lvIp.ListItems(lvIp.SelectedItem.Index).SubItems(1)
cboCom.Text = lvIp.ListItems(lvIp.SelectedItem.Index).SubItems(2)
Picture2.Visible = False
'hell:
'
'If Err.Number = 91 Then
'On Error Resume Next
'End If

End Sub

Private Sub Toolbar_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture2.Visible = False
End Sub
Private Sub StyleS()
On Error Resume Next
Dim ctrl As Control
For Each ctrl In Controls
If FrmStyles.txtnamastyle.Text = "Default" Then
Exit Sub
Else
    If (TypeOf ctrl Is ButtonNix) And _
        ctrl.Name <> "cmdSwitchStyle" Then
        ctrl.ButtonType = FrmStyles.txtlButtonType.Text
        ctrl.ColorScheme = FrmStyles.txtlColorScheme.Text
        ctrl.Backcolor = FrmStyles.txtlBackcolor.Text
        ctrl.BackOver = FrmStyles.txtlBackOver.Text
        ctrl.Forecolor = FrmStyles.txtlForecolor.Text
        ctrl.ForeOver = FrmStyles.txtlForeOver.Text
       
    End If
        If (TypeOf ctrl Is BLacKFrame) And _
        ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.BackColor1 = FrmStyles.frameBackColor1.Text
         ctrl.BackColor2 = FrmStyles.frameBackColor2.Text
         ctrl.BorderColor = FrmStyles.frameBorderColor.Text
         ctrl.Forecolor = FrmStyles.frameForecolor.Text
         ctrl.TitleColor1 = FrmStyles.frameTitleColor1.Text
         ctrl.TitleColor2 = FrmStyles.frameTitleColor2.Text
         If FrmStyles.frameBackGradient.Text = 0 Then
         ctrl.BackGradient = None
         ElseIf FrmStyles.frameBackGradient.Text = 1 Then
         ctrl.BackGradient = Vertical
         ElseIf FrmStyles.frameBackGradient.Text = 2 Then
         ctrl.BackGradient = Horizontal
         End If
         
         If FrmStyles.Frametitlegradient.Text = 0 Then
         ctrl.TitleGradient = None
         ElseIf FrmStyles.Frametitlegradient.Text = 1 Then
         ctrl.TitleGradient = Vertical
         ElseIf FrmStyles.Frametitlegradient.Text = 2 Then
         ctrl.TitleGradient = Horizontal
         End If

    End If
        If (TypeOf ctrl Is BLacKText) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Forecolor = FrmStyles.TForecolor.Text
         ctrl.Backcolor = FrmStyles.TBackcolor.Text
         ctrl.BackColorMain = FrmStyles.TBackColorMain.Text
         ctrl.BorderColor = FrmStyles.TBorderColor.Text
         ctrl.FocusBackColor = FrmStyles.TFocusBackColor.Text
         ctrl.FocusBackMainColor = FrmStyles.TFocusBackMainColor.Text
         ctrl.FocusBorderColor = FrmStyles.TFocusBorderColor.Text
         ctrl.FocusForeColor = FrmStyles.TFocusForeColor.Text
    End If
        If (TypeOf ctrl Is MSFlexGrid) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Backcolor = FrmStyles.GDBackcolor.Text
         ctrl.BackColorBkg = FrmStyles.GDBackColorBkg.Text
         ctrl.BackColorSel = FrmStyles.GDBackColorSel.Text
         ctrl.BackColorFixed = FrmStyles.GDBackColorFixed.Text
         ctrl.ForeColorSel = FrmStyles.GDForeColorSel.Text
         ctrl.Forecolor = FrmStyles.GDForecolor.Text
         ctrl.ForeColorFixed = FrmStyles.GDForeColorFixed.Text
         ctrl.GridColor = FrmStyles.GDGridColor.Text
         ctrl.GridColorFixed = FrmStyles.GDGridColorFixed.Text
    End If
        If (TypeOf ctrl Is TextBox) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Forecolor = FrmStyles.lbltextfore.Text
         ctrl.Backcolor = FrmStyles.lbltextback.Text
    End If
        If (TypeOf ctrl Is ComboBox) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Forecolor = FrmStyles.cboForeColor.Text
         ctrl.Backcolor = FrmStyles.cboBackcolor.Text
    End If
        If (TypeOf ctrl Is Label) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Forecolor = FrmStyles.lblForeColor.Text
    End If
        If (TypeOf ctrl Is RichTextBox) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Backcolor = FrmStyles.RcBackcolor.Text
    End If
    
            If (TypeOf ctrl Is OptionButton) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Forecolor = FrmStyles.opForecolor.Text
         ctrl.Backcolor = FrmStyles.opBackcolor.Text
    End If
            If (TypeOf ctrl Is ListView) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Backcolor = FrmStyles.LBackColor.Text
    End If
    Me.Backcolor = FrmStyles.WFore.Text
    End If
Next ctrl
End Sub

Private Sub tmrimage_Timer()
'On Error GoTo hell
rempic.Type = adTypeBinary
rec.Open "Select * from rem WHERE rem.noclient ='" & txtnoclient.Text & "' ", conn, adOpenStatic, adLockOptimistic
If rec.RecordCount = 0 Then
rec.Close
Else
rempic.Open
rempic.Write rec!pic
rempic.SaveToFile App.path & "/temp.brd", adSaveCreateOverWrite
rempic.Close
rec.Close

imgImage.Picture = LoadPicture(App.path & "\temp.brd")
End If

'IfNoErr:
'Exit Sub
'hell:
'If Err.Number = 3004 Then
'rempic.Close
'rec.Close
'MsgBox "You must be administrator to use Desktop Client.", vbInformation, "Not Admin"
'Unload Me
'Else
' TulisError Err.Description, Err.Number, "TmrImage", Me.Name
' Resume IfNoErr
'End If
End Sub
